# Contributor: Luca Weiss <luca@z3ntu.xyz>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=ayatana-indicator-keyboard
pkgver=22.2.2
pkgrel=0
pkgdesc="Ayatana Indicator Keyboard Applet"
url="https://github.com/AyatanaIndicators/ayatana-indicator-keyboard"
arch="all !s390x !riscv64" # blocked by accountsservice-dev
license="GPL-3.0-only"
makedepends="
	accountsservice-dev
	cmake
	cmake-extras
	glib-dev
	intltool
	libayatana-common-dev
	libx11-dev
	libxkbcommon-dev
	libxklavier-dev
	"
subpackages="$pkgname-dev $pkgname-lang"
source="https://github.com/AyatanaIndicators/ayatana-indicator-keyboard/archive/$pkgver/ayatana-indicator-keyboard-$pkgver.tar.gz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DENABLE_TESTS=ON \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
9aebc95cf68d11c7dc34f6d18fc14fbf96fba0ef83089568fab93049052ca905defad65f7436a931234b22ffadee1390d6f9751cec6a9e548acfd8bbca8c20f8  ayatana-indicator-keyboard-22.2.2.tar.gz
"
